package com.ruoyi.project.system.function.domain;

import com.ruoyi.project.system.dict.utils.DictUtils;
import com.ruoyi.project.system.function.bean.CategoryMap;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

/**
 * @program: NH
 * @description: 回显数据
 * @author: 郑吉志
 * @create: 2023-03-20 21:29
 **/
@Data
@EqualsAndHashCode
@Slf4j
@ToString
public class UIDetail {
    Integer id;
    Integer incomeDataId;
    Integer firstCategory;
    Integer secondaryCategory;
    Integer tertiaryCategory;
    String quantity;
    String amount;
    public UIDetail(DetailDB db){
        this.id=db.getId();
       this.incomeDataId=db.getIncomeDataId();
       this.firstCategory=db.getFirstCategory();
       this.secondaryCategory=db.getSecondaryCategory();
       this.tertiaryCategory=db.getTertiaryCategory();
        this.quantity=db.getQuantity()==null?"":db.getQuantity().toString();
        this.amount=db.getAmount()==null?"":String.format("%.2f",db.getAmount());
    }
}
